package Stream流;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class 中间方法num1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"高代起-100", "李柘宏-99", "韩瑞杰-98", "李东键-97", "郭昊-96", "史乃齐-95", "高代起-100");
        list.stream().filter(s -> s.split("-")[1].equals("100")).forEach(s-> System.out.println(s));
        ArrayList<String> arr = new ArrayList<>();
        Collections.addAll(arr, "宋雨琦", "小颗粒", "叶舒华", "赵美延", "田小娟");
        Stream.concat(list.stream(), arr.stream()).forEach(s -> System.out.print(s + " "));
        list.stream().distinct().forEach(s -> System.out.println(s));
        String[] strings = list.stream().toArray(value -> new String[value]);
        System.out.println(Arrays.toString(strings));
        List<String> collect = list.stream().collect(Collectors.toList());
        System.out.println(collect);
        Collection<String> collect1 = list.stream().collect(Collectors.toList());
        System.out.println(collect1);
        Map<String, Integer> collect2 = list.stream().limit(6).collect(Collectors.toMap(s -> s.split("-")[0], s -> Integer.parseInt(s.split("-")[1])));
        System.out.println(collect2);
    }
}
